import java.util.Arrays;

public class Solution1310 {
    public int[] xorQueries(int[] arr, int[][] queries) {
        int[] f=new int[arr.length+1];
        for (int i=0;i<arr.length;i++){
            f[i+1]=f[i]^arr[i];
        }
        int[] ans=new int[queries.length];
        for (int i=0;i<queries.length;i++){
            ans[i]=f[queries[i][0]]^f[queries[i][1]+1];
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(new Solution1310().xorQueries(new int[]{1,3,4,8},new int[][]{{0,1},{1,2},{0,3},{3,3}})));
    }
}
